home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WCURSOR_HPP_INCLUDED
- #define _WCURSOR_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WPOINT_HPP_INCLUDED
- # include "wpoint.hpp"
- #endif
- #ifndef _WRECT_HPP_INCLUDED
- # include "wrect.hpp"
- #endif
- #ifndef _WRESID_HPP_INCLUDED
- # include "wresid.hpp"
- #endif
-
- enum WStockCursor {
- WSCPointer,
- WSCCrossHair,
- WSCIBeam,
- WSCSize,
- WSCSizeNESW,
- WSCSizeNS,
- WSCSizeNWSE,
- WSCSizeWE,
- WSCWait,
- WSCNo,
- WSCAppStarting,
- WSCHelp,
- WSCLast = WSCHelp
- };
-
- enum WCursorColor {
- WCWhite,
- WCBlack,
- WCBlackWhite
- };
-
- class WCursorReference;
- class WBitmap;
-
- class WCMCLASS WCursor : public WObject {
- WDeclareSubclass( WCursor, WObject );
-
- public:
-
- /***************************************************************
- * Constructors and Destructors
- ***************************************************************/
-
- WCursor();
- WCursor( const WResourceID & id, WModuleHandle loadFrom=_ApplicationModule );
- WCursor( const WStockCursor crs );
- WCursor( const WCursorHandle crs, WBool deleteHandle=FALSE );
- WCursor( const WCursor & cursor );
- WCursor( const WChar * file, WBool monochrome );
- WCursor( const WBitmap & bitmap, WPoint hotPoint, WCursorColor color = WCBlack );
-
- ~WCursor();
-
- /***************************************************************
- * Properties
- ***************************************************************/
-
- // Handle
-
- WCursorHandle GetHandle() const;
-
- // Valid
- //
- // TRUE if cursor was created/loaded.
-
- WBool GetValid() const;
-
- /***************************************************************
- * Methods
- ***************************************************************/
-
- // Clear
-
- void Clear();
-
- // Create
-
- WBool Create( const WResourceID & id, WModuleHandle from=_ApplicationModule );
- WBool Create( const WStockCursor stockCursor );
- WBool Create( const WCursorHandle handle, WBool delHandle=FALSE );
- WBool Create( const WCursor & cursor );
- WBool Create( const WChar * file, WBool monochrome=FALSE );
- WBool Create( const WBitmap & bitmap, WPoint hotPoint, WCursorColor color = WCBlack );
-
- /***************************************************************
- * Static Properties
- ***************************************************************/
-
- // ClipArea
- //
- // Get or set the clipping area (in screen coordinates) for
- // the cursor. A clip area with a width or height of 0
- // resets the clip area to the whole desktop.
-
- static WRect GetClipArea();
- static WBool SetClipArea( const WRect & r );
-
- // Position
- //
- // Get or set the position of the cursor on the screen.
- // Position is in screen coordinates.
-
- static WPoint GetPosition();
- static WBool SetPosition( const WPoint & pt );
-
- /***************************************************************
- * Static Methods
- ***************************************************************/
-
- // Hide
- //
- // Decrement the display count for the cursor. The cursor
- // is not visible if the display count < 0. Returns the
- // new display count.
-
- static WInt Hide();
-
- // Show
- //
- // Increment the display count for the cursor. The cursor
- // is visible only if the display count >= 0. Returns the
- // new display count.
-
- static WInt Show();
-
- /***************************************************************
- * Operators
- ***************************************************************/
-
- WCursor & operator=( const WCursor & cursor );
-
- /***************************************************************
- * Data Members
- ***************************************************************/
-
- private:
-
- WCursorReference * _ref;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WCURSOR_HPP_INCLUDED
-